package com.Excise;

public class Reverse_str {
  public static void main(String[] args) {
    // 有字符串“this is my homework! I must finish it!”，
    // 要求
    // 1.jpg.将其反转
    // 2.统计单词个数
    StringBuilder s1 = new StringBuilder("this is my homework! I must finish it!");
    String s = s1.reverse().toString();
    System.out.println(s);

    String s2 = "this is my homework! I must finish it!";
    String[] sarr = new String[s2.length()];
    sarr = s2.split("");
    int count = 0;
    for (String s3 : sarr) {
      //
      if (s3.isBlank()) {
        count += 1;
      }
    }
    System.out.println(count + 1);


  }
}
